package com.hinnotek.amoeba.viewmodels


import androidx.lifecycle.viewModelScope
import com.hinnotek.amoeba.bean.old.UserChangeLoginPwdBean
import com.hinnotek.amoeba.repo.UserRepo
import com.lee.common.base.BaseViewModel
import com.lee.common.network.net.StateLiveData
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class UserViewModel @Inject constructor(private val userRepo: UserRepo) : BaseViewModel() {

    var changePassData = StateLiveData<UserChangeLoginPwdBean>()

    fun changePass(
        userId: Int,
        password: String,
        rePassword: String
    ): StateLiveData<UserChangeLoginPwdBean> {
        viewModelScope.launch {
            userRepo.changePass(userId, password, rePassword, changePassData)
        }
        return changePassData
    }


}